<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/



Route::group(['namespace' => 'Api', 'middleware' => ['moon.auth','ao']], function (){
    Route::get('/activity/goods', 'ActivityGoodsController@goodsList');
    Route::post('/activity/goods/chose', 'ActivityGoodsController@choseGoods');
    Route::post('/activity/goods/answer', 'ActivityGoodsController@answer');

    Route::get('/activity/user', 'ActivityUserController@getActivityUserInfo');

    Route::get('/activity/user/answer', 'ActivityUserController@answer');
    Route::get('/activity/user/invite', 'ActivityUserController@myInvite');
    Route::get('/activity/user/rand', 'ActivityUserController@rank');
    Route::post('/send/check/code', 'SendSmsController@checkCode');
    Route::post('/activity/user/bind-mobile', 'ActivityUserController@bindMobile');
    Route::get('/activity/user/is-bind-mobile', 'ActivityUserController@isBindMobile');

    Route::get('/activity/user/{uid}', 'ActivityUserController@getUserInfo');

    Route::post('/activity/prize', 'ActivityGoodsController@prizeLog');
    Route::post('/activity/address', 'ActivityUserController@address');

    Route::get('/activity/cy-count', 'ActivityUserController@cyCount');

});


Route::group(['namespace' => 'Api', 'prefix' => 'wechat', 'middleware' => ['ao']], function (){
    Route::any('/open-platform/pre-auth', 'WechatController@openPlatformPreAuth');
    Route::any('/open-platform/callback', 'WechatController@openPlatformPreAuthCallback');
    Route::any('/open-platform/login/callback/{appid}', 'WechatController@openPlatformLoginCallback');
    Route::any('/open-platform/login/{appid}', 'WechatController@openPlatformLogin');
    Route::any('/open-platform', 'WechatController@openPlatform');

    Route::any('/open-platform/jssdk/{appid}', 'WechatController@openPlatformJsSdk');

    Route::any('/open-platform/{appid}/callback', 'WechatController@openPlatformCallback');
});